Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 plugin infrastructure #502

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from

Conversation

bitphage
Copy link
Collaborator

@bitphage bitphage commented Feb 28, 2019

Closes #500

"dexbot" logger should use same verbosity settings defined for
per_worker logger and also it should log into file 'dexbot.log' too.
Plugins are python classes supposed to serve as workers to perform any additional
operations which are not performed from strategies. Example use-cases:

* Download trading history
* Analyze trading history
* Check for updates
* Report dexbot statistic

Current implementation uses separate thread and asyncio event loop
inside. This is a temporary solution before refactoring
WorkerInfrastructure to asyncio.

Closes: Codaone#500
@bitphage bitphage force-pushed the 500-plugin-infrastructure branch from db80b49 to 43092dc Compare February 28, 2019 14:57
@@ -173,6 +174,8 @@ def add_worker(self, worker_name, config):
self.update_notify()

def run(self):
self.plugins_thread = PluginInfrastructure(self.config)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initialize self.plugins_thread in __init__


log = logging.getLogger(__name__)

class PluginInfrastructure(threading.Thread):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add one extra line above, PEP8 error.

import dexbot.plugins
from dexbot.helper import iter_namespace

from bitshares import BitShares
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works but to be more specific change to from bitshares.bitshares import BitShares.

logging.getLogger("dexbot").addHandler(ch)
logging.getLogger("dexbot").addHandler(fh)
logging.getLogger("dexbot").setLevel(getattr(logging, verbosity.upper()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolve conflict in ui.py

@Shaynomaino
Copy link

#502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants